<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="三包申请明细">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" ng-click="switchToolbar('ColConfig');"
                            title="配置表格列">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" >
                            <div title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam" download-key="ids">
                                    <i class="yb-icon ico-export-o"></i> 导出
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                    <i class="yb-icon ico-export-o"></i> 导出全部
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs"
                        ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="三包申请单号"
                            ng-model="condition.purchaseNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">三包申请单号：</label>
                        <textarea ng-model="condition.billNos" class="form-control" placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" ng-model="condition.customerName" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <textarea ng-model="condition.purchaseNames" class="form-control"
                            placeholder="逗号分隔或者换行分隔"></textarea>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">单据状态：</label>
                        <select class="form-control" ng-model="condition.guaraenteesStatus"
                            ng-options="item.code as item.name for item in billStateList">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">出库状态：</label>
                        <select class="form-control" ng-model="condition.status"
                            ng-options="item.code as item.name for item in statusList">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">CRM单号：</label>
                        <input type="text" class="form-control" ng-model="condition.crmOrder">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">零件号：</label>
                        <input type="text" class="form-control" ng-model="condition.materialsNo">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">序列号：</label>
                        <input type="text" class="form-control" ng-model="condition.machineNumber">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">产品型号：</label>
                        <input type="text" class="form-control" ng-model="condition.prodType">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">服务人员：</label>
                        <input type="text" class="form-control" ng-model="condition.serviceName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">服务网点：</label>
                        <input type="text" class="form-control" ng-model="condition.serviceSite">
                    </div>
                     <div class="form-group clearfix">
                        <label class="control-label">服务信息单号：</label>
                        <input type="text" class="form-control" ng-model="condition.serviceNo">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">是否返厂：</label>
                        <select class="form-control" ng-model="condition.isReturn">
                            <option value="">请选择</option>
                            <option value="否">否</option>
                            <option value="是">是</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">实际返厂：</label>
                        <select class="form-control" ng-model="condition.actualReturn">
                            <option value="">请选择</option>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">发运时间：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.deliveryReceiptStart"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showDatedeliveryReceiptStart = !showDatedeliveryReceiptStart"
                            ng-change="checkDate(condition, 'deliveryReceiptStart', 'deliveryReceiptEnd')"
                            is-open="showDatedeliveryReceiptStart" close-text="关闭" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.deliveryReceiptEnd"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showDatedeliveryReceiptEnd = !showDatedeliveryReceiptEnd"
                            ng-change="checkDate(condition, 'deliveryReceiptStart', 'deliveryReceiptEnd')"
                            is-open="showDatedeliveryReceiptEnd" close-text="关闭" modal-size="small" readonly>
                    </div>
                     <div class="form-group clearfix">
                        <label class="control-label">仓库：</label>
                        <input type="text" class="form-control" ng-model="condition.warehouseCode">
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">签收时间：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.receiveDateStart"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showReceiveDateStart = !showReceiveDateStart"
                            ng-change="checkDate(condition, 'receiveDateStart', 'receiveDateEnd')"
                            is-open="showReceiveDateStart" close-text="关闭" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.receiveDateEnd"
                            datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="showReceiveDateEnd = !showReceiveDateEnd"
                            ng-change="checkDate(condition, 'receiveDateStart', 'receiveDateEnd')"
                            is-open="showReceiveDateEnd" close-text="关闭" modal-size="small" readonly>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allChecked"
                                            yb-click="selectAll()"></div>
                                    </th>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.billFixedWidth"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item)">
                                        </div>
                                    </td>
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button type="button" class="btn btn-operate m-r-xs" ng-click="editApply(item)"
                                                    ng-disabled="item.guaraenteesStatus != '0' && item.guaraenteesStatus != '3' || !btnPermission.guaranteesApplyEdit"
                                                    title="{{!btnPermission.guaranteesApplyEdit?'无权限执行此操作':''}}">编辑</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
    </div>
</div>